import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)
const routes = [

  {
    path: '/home',
    component: () => import('../views/Home/index.vue')
  },
  {
    path: '/goods_cate',
    component: () => import('../views/goods_cate')
  },
  {
    path: '/user',
    component: () => import('../views/user')
  },
  {
    path: '/cart',
    component: () => import('../views/cart')
  },
  // 跳转至商品分类
  {
    path: "/pages/goods_cate/goods_cate",
    component: () => import("../views/goods_cate")
  },
  // 领优惠卷
  {
    path: "/pages/users/user_get_coupon/index",
    component: () => import('../views/News/Newlist/newlist.vue')
  },
  // 行业资讯
  {
    path: "/pages/news_list/index",
    component: () => import('../views/News/Newlist/zixunlist.vue'),
    props: true
  },
  // 行业资讯详情
  {
    path: "/pages/news_details/index/id=:id",
    component: () => import('../views/News/Newinfo/newinfo.vue'),
    props: true
  },
  // 首页地址管理
  {
    path: "/pages/users/user_address/index",
    component: () => import('../views/address/address.vue'),
    props: true
  },
  // 拼团活动
  {
    path: "/pages/activity/goods_combination/index",
    component: () => import('../views/combination/combination.vue'),
  },
  //首页购物车路由
  {
    path: '/goods_combination_details/index',
    component: () => import("../views/goods_cate/goods_combination_details"),
    props: true
  },
  {
    path: "/goods_search",
    component: () => import("../views/goods_search")
  },
  // 我的收藏
  {
    path: "/pages/users/user_goods_collection/index",
    component: () => import('../views/shoucan/shoucan.vue'),
    props: true
  },
  // 限时秒杀
  {
    path: "/pages/activity/goods_seckill/index",
    component: () => import("../views/xianshi/xianshi.vue")
  },
  // 砍价列表 
  {
    path: "/pages/activity/goods_bargain/index",
    component: () => import("../views/kanjia/kanjia.vue")
  },

  // 购物车
  {
    path: "/cart",
    component: () => import("../views/cart/index.vue"),
    props: true,
    meta: {
      title: "购物车"
    }
  },

  {
    path:'/pages/users/user_info/index',
    component:()=>import("../views/user/userinfo/index.vue"),
    props:true
  },
  {
    path: '/user_photo',
    component: () => import("../views/user/user-photo/index.vue")
  },
  {
    path:'/pages/activity/bargain/index',
    component:()=>import("../views/user/bargain/index.vue")
  },
  {
    path:'/pages/users/user_spread_user/index',
    component:()=>import("../views/user/user_spread_user/index.vue")
  },
  {
    path:'/pages/users/user_address_list/index',
    component:()=>import("../views/user/user_address_list/index.vue")
  },
  {
    path:'/pages/users/user_goods_collection/index',
    component:()=>import("../views/user/user_integral")
  },
  {
    path:'/pages/users/user_money/index',
    component:()=>import("../views/user/user-money/index.vue")
  },
  {
    path:'/pages/users/user_integral/index',
    component:()=>import("../views/user/user_integral/index.vue")
  },
  {
    path:'/pages/users/user_vip/index',
    component:()=>import("../views/user/user-vip/index.vue")
  },
  {
    path:'/bianji',
    component:()=>import("../views/user/user_address_list/bianji.vue")
  },
  {
    path: '*',
    // redirect: '/home'
    component: () => import('../components/login/login.vue')
  },
  // 我要签到
  {
    path: "/pages/users/user_sgin/index",
    component: () => import("../views/qiandao/qiandao.vue")
  },
  // 跳转到签到明细
  {
    path:"/pages/users/user_sgin_list/index",
    component:()=>import("../components/qiandao/qiandao.vue")
  },
  // 订单管理
  {
    path:"/pages/users/order_list/index",
    component:()=>import("../views/dingdan/dingdan.vue")
  }

]

const router = new VueRouter({
  mode: "hash",
  routes
})
export default router